IF EXISTS (SELECT *
           FROM INFORMATION_SCHEMA.VIEWS
           WHERE TABLE_NAME='vds{PAGE_NAME}'
           AND TABLE_SCHEMA='dbo'
          )
          DROP VIEW dbo.vds{PAGE_NAME}
GO

CREATE VIEW dbo.vds{PAGE_NAME}
AS
/*@@*_____________________________________________________________________

  (c) 2001-2004 ExecuTRACK Software AG

  Object:  dbo.vds{PAGE_NAME}
  Author:  {AUTHOR_NAME}
  Created: {CREATION_DATE}

  Purpose:
    This view returns {PAGE_NAME} information for a {RECORD_TYPE}, needed for
    the filter builder.

  Revision History:
    Author dd-mmm-yyyy Purpose

_____________________________________________________________________*@@*/

  SELECT
    {TABLE_ALIAS}.{PRIMARY_KEY},
    {TABLE_ALIAS}.{PAGE_KEY},
    SysL.SysLID,
    {FIELD_LIST}

  FROM
    t{TABLE_NAME} {TABLE_ALIAS}

    CROSS JOIN vzSysLanguage SysL

  WHERE ({TABLE_ALIAS}.{PAGE_KEY} <> -1)

GO